import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'input_dialog_widget.dart';

class InputDialogUtil {

  /// 显示文本输入对话框
  /// title: 标题
  /// count: 副标题
  /// sureEvent: 确认点击事件
  /// canceEvent: 取消点击事件
  /// onChangedEvent: 输入框改变事件
  void showInputDialogWidget(String? title,
      {int count = 4,Function()? canceEvent,Function(String? content)? sureEvent,Function(String? content)? onChangedEvent}) {
    Get.generalDialog(
        barrierDismissible: true,
        barrierLabel: '',
        pageBuilder: (BuildContext context, Animation<double> animation,
            Animation<double> secondaryAnimation) {
          return Dialog(
              backgroundColor: Colors.transparent,
              child: InputDialogWidget(
                title,
                count: count,
                sureEvent: sureEvent,
                canceEvent: canceEvent,
                onChangedEvent: onChangedEvent,
              ));
        });
  }
}